//package com.cxy.usercenter.rocketmq;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.cloud.stream.annotation.StreamListener;
//import org.springframework.cloud.stream.messaging.Sink;
//import org.springframework.messaging.Message;
//import org.springframework.messaging.support.ErrorMessage;
//import org.springframework.stereotype.Service;
//
///**
// * @author: huayushu luming
// * @date: 2020-12-01 12:57
// * @desc:
// **/
//@Service
//@Slf4j
//public class TestStreamConsumer {
//    @StreamListener(Sink.INPUT)
//    public void receive(String messageBody){
//        log.info("通过stream收到了消息：messageBody={}",messageBody);
//        //throw new IllegalArgumentException("主动抛出异常");
//    }
//
//    @StreamListener("errorChannel")
//    public void error(Message<?> message) {
//        ErrorMessage errorMessage = (ErrorMessage) message;
//        System.out.println("Handling ERROR: " + errorMessage);
//        log.warn("发送异常，errorMessage={}",errorMessage);
//    }
//
//}
